home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / Universal Headers 2.0.1f / ControlStrip.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-22  |  6.1 KB  |  167 lines  |  [TEXT/MMCC]

  1. /*
  2.      File:        ControlStrip.h
  3.  
  4.      Contains:    Control Strip (for Powerbooks and Duos) Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __CONTROLSTRIP__
  21. #define __CONTROLSTRIP__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __MENUS__
  30. #include <Menus.h>
  31. #endif
  32. /*    #include <Memory.h>                                            */
  33. /*        #include <MixedMode.h>                                    */
  34. /*    #include <Quickdraw.h>                                        */
  35. /*        #include <QuickdrawText.h>                                */
  36.  
  37. #ifndef __DIALOGS__
  38. #include <Dialogs.h>
  39. #endif
  40. /*    #include <Errors.h>                                            */
  41. /*    #include <Windows.h>                                        */
  42. /*        #include <Events.h>                                        */
  43. /*            #include <OSUtils.h>                                */
  44. /*        #include <Controls.h>                                    */
  45. /*    #include <TextEdit.h>                                        */
  46.  
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50.  
  51. #if PRAGMA_ALIGN_SUPPORTED
  52. #pragma options align=mac68k
  53. #endif
  54.  
  55. #if PRAGMA_IMPORT_SUPPORTED
  56. #pragma import on
  57. #endif
  58.  
  59.  
  60. enum {
  61.     sdevInitModule                = 0,                            /* initialize the module*/
  62.     sdevCloseModule                = 1,                            /* clean up before being closed*/
  63.     sdevFeatures                = 2,                            /* return feature bits*/
  64.     sdevGetDisplayWidth            = 3,                            /* returns the width of the module's display*/
  65.     sdevPeriodicTickle            = 4,                            /* periodic tickle when nothing else is happening*/
  66.     sdevDrawStatus                = 5,                            /* update the interface in the Control Strip*/
  67.     sdevMouseClick                = 6,                            /* user clicked on the module's display area in the Control Strip*/
  68.     sdevSaveSettings            = 7,                            /* saved any changed settings in module's preferences file*/
  69.     sdevShowBalloonHelp            = 8                                /* puts up a help balloon, if the module has one to display*/
  70. };
  71.  
  72. /*********************************************************************************************
  73.  
  74.     Features supported by the module.  If a bit is set, it means that feature is supported.
  75.     All undefined bits are reserved for future use by Apple, and should be set to zero.
  76.  
  77. *********************************************************************************************/
  78. enum {
  79.     sdevWantMouseClicks            = 0,                            /* notify the module of mouseDown events*/
  80.     sdevDontAutoTrack            = 1,                            /* call the module to do mouse tracking*/
  81.     sdevHasCustomHelp            = 2,                            /* module provides its own help messages*/
  82.     sdevKeepModuleLocked        = 3                                /* module needs to be locked in the heap*/
  83. };
  84.  
  85. /*********************************************************************************************
  86.  
  87.     Result values returned by the sdevPeriodicTickle and sdevIconMouseClick selectors.
  88.     If a bit is set, the module can request that a specific function is performed by
  89.     the Control Strip.  A result of zero will do nothing.  All undefined bits are reserved
  90.     for future use by Apple, and should be set to zero.
  91.  
  92. *********************************************************************************************/
  93. enum {
  94.     sdevResizeDisplay            = 0,                            /* resize the module's display*/
  95.     sdevNeedToSave                = 1,                            /* need to save changed settings, when convenient*/
  96.     sdevHelpStateChange            = 2,                            /* need to update the help message because of a state change*/
  97.     sdevCloseNow                = 3                                /* close a module because it doesn't want to stay around*/
  98. };
  99.  
  100. /*********************************************************************************************
  101.  
  102.     miscellaneous
  103.  
  104. *********************************************************************************************/
  105. enum {
  106.     sdevFileType                = 'sdev'
  107. };
  108.  
  109. enum {
  110.     sdevMenuItemMark            = '•'
  111. };
  112.  
  113. /*    direction values for SBDrawBarGraph*/
  114. enum {
  115.     BarGraphSlopeLeft            = -1,                            /* max end of sloping bar graph is on the left*/
  116.     BarGraphFlatRight            = 0,                            /* max end of flat bar graph is on the right*/
  117.     BarGraphSlopeRight            = 1                                /* max end of sloping bar graph is on the right*/
  118. };
  119.  
  120. /*********************************************************************************************
  121.  
  122.     utility routines to provide standard interface elements and support for common functions
  123.  
  124. *********************************************************************************************/
  125. extern pascal Boolean SBIsControlStripVisible(void)
  126.  TWOWORDINLINE(0x7000, 0xAAF2);
  127. extern pascal void SBShowHideControlStrip(Boolean showIt)
  128.  THREEWORDINLINE(0x303C, 0x0101, 0xAAF2);
  129. extern pascal Boolean SBSafeToAccessStartupDisk(void)
  130.  TWOWORDINLINE(0x7002, 0xAAF2);
  131. extern pascal short SBOpenModuleResourceFile(OSType fileCreator)
  132.  THREEWORDINLINE(0x303C, 0x0203, 0xAAF2);
  133. extern pascal OSErr SBLoadPreferences(ConstStr255Param prefsResourceName, Handle *preferences)
  134.  THREEWORDINLINE(0x303C, 0x0404, 0xAAF2);
  135. extern pascal OSErr SBSavePreferences(ConstStr255Param prefsResourceName, Handle preferences)
  136.  THREEWORDINLINE(0x303C, 0x0405, 0xAAF2);
  137. extern pascal void SBGetDetachedIndString(StringPtr theString, Handle stringList, short whichString)
  138.  THREEWORDINLINE(0x303C, 0x0506, 0xAAF2);
  139. extern pascal OSErr SBGetDetachIconSuite(Handle *theIconSuite, short theResID, unsigned long selector)
  140.  THREEWORDINLINE(0x303C, 0x0507, 0xAAF2);
  141. extern pascal OSErr SBTrackPopupMenu(const Rect *moduleRect, MenuHandle theMenu)
  142.  THREEWORDINLINE(0x303C, 0x0408, 0xAAF2);
  143. extern pascal OSErr SBTrackSlider(const Rect *moduleRect, short ticksOnSlider, short initialValue)
  144.  THREEWORDINLINE(0x303C, 0x0409, 0xAAF2);
  145. extern pascal OSErr SBShowHelpString(const Rect *moduleRect, StringPtr helpString)
  146.  THREEWORDINLINE(0x303C, 0x040A, 0xAAF2);
  147. extern pascal short SBGetBarGraphWidth(short barCount)
  148.  THREEWORDINLINE(0x303C, 0x010B, 0xAAF2);
  149. extern pascal void SBDrawBarGraph(short level, short barCount, short direction, Point barGraphTopLeft)
  150.  THREEWORDINLINE(0x303C, 0x050C, 0xAAF2);
  151. extern pascal void SBModalDialogInContext(ModalFilterUPP filterProc, short *itemHit)
  152.  THREEWORDINLINE(0x303C, 0x040D, 0xAAF2);
  153.  
  154. #if PRAGMA_IMPORT_SUPPORTED
  155. #pragma import off
  156. #endif
  157.  
  158. #if PRAGMA_ALIGN_SUPPORTED
  159. #pragma options align=reset
  160. #endif
  161.  
  162. #ifdef __cplusplus
  163. }
  164. #endif
  165.  
  166. #endif /* __CONTROLSTRIP__ */
  167.